﻿@using RazorEngine.Templating
@using codeGen.Model;
@*  @inherits TemplateBase<ClassMetadata>; *@
using Lord.Platform.Domain.Entities.Land;
using Lord.Platform.Domain.Share.Enum;
using System.ComponentModel.DataAnnotations.Schema;

namespace Test
{
    /// <summary>
    /// @Model.ClassComment 
    /// </summary>
    [SugarTable("@(Model.ClassName.ToLower())", TableDescription = "@Model.ClassComment")]
    public class @Model.ClassName :BaseModel
    {
    @foreach (var prop in Model.Fields)
    {
        @:/// <summary>
        @:/// @prop.FieldComment 
        @:/// </summary>

        @switch (prop.FieldType)
        {
            case "string":
                @:[SugarColumn(ColumnName = "@(prop.FieldName.ToLower())", ColumnDescription = "@prop.FieldComment", Length = 200, IsNullable = true)]
                @:public @prop.FieldType @prop.FieldName { get; set; }
                break;
            case "int":
                @:[SugarColumn(ColumnName = "@(prop.FieldName.ToLower())", ColumnDescription = "@prop.FieldComment", IsNullable = true)]
                @:public @prop.FieldType @prop.FieldName { get; set; }
                break;
            case "decimal":
                @:[SugarColumn(ColumnName = "@(prop.FieldName.ToLower())", ColumnDescription = "@prop.FieldComment", Length = 18, DecimalDigits = 4, IsNullable = true)]
                @:public @prop.FieldType @prop.FieldName { get; set; }
                break;
            default:
                @:[SugarColumn(ColumnName = "@(prop.FieldName.ToLower())", ColumnDescription = "@prop.FieldComment", IsNullable = true)]
                @:public @prop.FieldType @prop.FieldName { get; set; }
                break;

        }
    }
    }
}